﻿using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Security.Encryption;
using Microsoft.Extensions.DependencyInjection;

namespace taigu
{
    class BaseAppService : IBaseAppService
    {
        private readonly IHttpContextAccessor _httpContextAccessor;

        private readonly IStringEncryptionService _stringEncryptionService;
        public BaseAppService(IHttpContextAccessor httpContextAccessor, IStringEncryptionService stringEncryptionService)
        {
            _httpContextAccessor = httpContextAccessor;
            _stringEncryptionService = stringEncryptionService;
        }
        public virtual string Token()
        {
            string x = _stringEncryptionService.Encrypt("1q2w3E*");
            string s = _stringEncryptionService.Decrypt(x);

            IHeaderDictionary keyValuePairs = _httpContextAccessor.HttpContext.Request.Headers;
            string token = keyValuePairs["authoration"];
            return token;
        }
    }
}
